<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateWechatsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wechats', function (Blueprint $table) {
            $table->unsignedBigInteger('id')->primary();
            $table->string('name',64)->default('')->comment('名称');
            $table->string('gender',64)->default('男')->comment('性别');
            $table->enum('role',['PARTNER','MEMBER'])->default('PARTNER')->index('role');
            $table->enum('status',['ENABLE','DISABLE'])->default('ENABLE')->index('status');
            $table->dateTime('disable_time')->nullable()->comment('启用时间');
            $table->string('phone',16)->default('')->comment('手机号');
            $table->string('open_id',64)->default('')->comment('身份证号');
            $table->string('session_key')->default('')->comment('微信session');
            $table->string('avatar_url',255)->default('')->comment('头像');
            $table->string('password')->default('');
            $table->string('hobby')->comment('爱好');
            $table->rememberToken();
            $table->timestamps();
            $table->softDeletes();
            $table->charset = 'utf8mb4';
            $table->collation = 'utf8mb4_unicode_ci';
            $table->engine = 'InnoDB';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wechats');
    }
}
